package com.bcu.cn.onlineexamsystem.exammanage.mapper;

import com.bcu.cn.onlineexamsystem.exammanage.entity.Class;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface ClassMapper {
    
    @Select("SELECT c.* FROM classes c " +
            "INNER JOIN teacher_classes tc ON c.class_id = tc.class_id " +
            "WHERE tc.teacher_id = #{teacherId}")
    List<Class> findByTeacherId(String teacherId);
    
    @Select("SELECT * FROM classes WHERE class_id = #{classId}")
    Class findById(Long classId);

    @Select("SELECT * FROM classes")
    List<Class> findAll();
} 